package com.sixth.dao;

import com.sixth.entity.AclRole;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

@Component
public interface AclRoleDao {
    int deleteByPrimaryKey(String id);

    int insert(AclRole record);

    int insertSelective(AclRole record);

    AclRole selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(AclRole record);

    int updateByPrimaryKey(AclRole record);

    //角色管理
    List<AclRole> findRoleByPage(@Param("roleName") String roleName,@Param("isDeleted") Integer isDeleted);

    //修改角色状态
    int updateRoleStatusByid(@Param("id") String id,@Param("deleted") String deleted);

    //查询count(*)
    int selectcount();

    //添加角色
    int addORole(@Param("id1") String id1,@Param("roleName") String roleName,@Param("roleCode") String roleCode,@Param("remark") String remark,@Param("isDeleted") Integer isDeleted,@Param("gmtCreate") Date gmtCreate,@Param("gmtModified") Date gmtModified);

    //修改角色
    int updateORole(@Param("id2") String id2,@Param("remark") String remark,@Param("roleName") String roleName, @Param("date") Date date,@Param("code") String code);

    //删除角色
    int deleteRoleById(@Param("roleid") String roleid);


    List<String> findRoleByUserId(@Param("id") String userId);

    List<String> findAllRoleid();

    //根据name查询全部role
    List<AclRole> findRoleByRoleName(@Param("roleName") String roleName);

    //查找用户和权限中间表内数据的个数
    int findcount();

    int insertRole(@Param("aurid") String aurid,@Param("ids") String ids,@Param("id") String id,@Param("date") Date date);

    int deleteUserIdAndRoleId(@Param("id") String id);
}